home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / dsiic2.zip / L_GETKEY.C < prev    next >
C/C++ Source or Header  |  1991-07-15  |  715b  |  31 lines

  1. /* Copyright (c) James L. Pinson 1990,1991  */
  2.  
  3. /**********************   L_GETKEY.C  ***************************/
  4.  
  5. #include "mydef.h"
  6. #include <conio.h>
  7.  
  8.  
  9.  
  10. /*****************************************************************
  11.  
  12.  Usage: void get_key(char *ch, char *ext);
  13.  
  14.  
  15.   char *ch=  character to read from keyboard.
  16.  
  17.   char *ext= extended character (if any).
  18.  
  19.   Reads character and extended character from keyboard.
  20.  
  21. *****************************************************************/
  22.  
  23. void get_key(char *ch, char *ext)
  24. {
  25.   *ch=getch();      /* get the character */
  26.  
  27.     if(!*ch){       /* if the character is zero (a special key) */
  28.       *ext=getch(); /* get the extension */
  29.     }
  30. }
  31.